<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>指定的字符结尾</title>
</head>
<!--  function(){   
    }
    fun(arr,value) -->
    <!-- 如果是，返回true;如果不是，返回false。 -->
    <script>
        var arr='5854884456485565'
        var arr1='581485565'
function fn(a,b){
if(a.substring(arr.length,-2) ===b.substring(arr1.length,-2) ){
             return true
         }else{
             return false
         }
        }
    var res = fn(arr,arr1)
    console.log(res);
    </script>
<body>
    
</body>
</html>